<%--
 $Author: muj $
 $Rev: 5599 $
 $Date:: 2013-03-28 18:46:48#$:

 Copyright (C) 2012 Seeyon, Inc. All rights reserved.
 This software is the proprietary information of Seeyon, Inc.
 Use is subject to license terms.
--%>
<%@ page contentType="text/html; charset=utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="ctp" uri="http://www.seeyon.com/ctp"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="path" value="${pageContext.request.contextPath}" />

<link rel="stylesheet" type="text/css" href="/seeyon/portal/icons/default/fonts/plane/iconfont.css${ctp:resSuffix()}">
<link rel="stylesheet" type="text/css" href="/seeyon/skin/dist/fonts/common/iconfont.css${ctp:resSuffix()}">
  

<script type="text/javascript">
	var _praisedealCa ="${ctp:i18n('collaboration.summary.label.praisecancel')}";
	var _praisedeal ="${ctp:i18n('collaboration.summary.label.praise')}";
    var jsonArrBase = '${basicButs}';
    var jsonArrCommon = '${commonButs}';
    var jsonArradvance = '${advancedButs}';
    var nodeattitudeListSize = "${nodeattitudeListSize}" || "0";
    var _accountId = "${accountId}";
    var adminType= "${adminType}";
    var formId = "${formId}";
    var attitudeList = <c:out value="${attitudeList}" default="null" escapeXml="false"/>;

</script>

<%-- <script type="text/javascript" charset="UTF-8" src="${path}/apps_res/collaboration/js/dealNodeCommon.js${ctp:resSuffix()}"></script> --%>

<script type="text/javascript" charset="UTF-8" src="${path}/apps_res/permission/js/permissionDataHandler.js${ctp:resSuffix()}"></script>
<script type="text/javascript" charset="UTF-8" src="${path}/apps_res/collaboration/js/deal.js${ctp:resSuffix()}"></script>




<style>

    .ico16:before{
      content: "" !important;
    }
    .common_drop_list .common_drop_list_content a.nodePerm,.nodePerm {
        display: none;
    }
    #_dealDiv{
        padding-left:20px;
    }
    #_dealDiv .common_button{
        width:auto;
        max-width:220px;
        height: 26px;
        line-height: 24px;
        padding: 0 11px !important;
    }
    #_dealDiv .common_button_emphasize, ._dealDiv .common_button_emphasize, #display_content_view .area_top .common_button_emphasize{
        width:auto;
        max-width:220px;
        background-color:#009DEF;
        border: 1px solid #009DEF;
        height: 26px;
        line-height: 24px;
        padding: 0 11px !important;
    }
    .back_disable_color{
        cursor: default;
        color: #000;
        opacity: 0.2;
        -moz-opacity: 0.2;
        -khtml-opacity: 0.2;
        filter: alpha(opacity=20);
    }
    .common_toolbar_box  .toolbar_l a{
        margin-top:3px;
    }
    .common_toolbar_box .toolbar_l a em{
        position: relative;
        display: inline-block;
        float:left;
        line-height:24px;
    }
    .common_toolbar_box .toolbar_l .menu_span{
        max-width: 180px;
        overflow: hidden;
        display:block;
        float:left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .common_toolbar_box { background:none; height: 32px;}
    .toolbar_l a { border:solid 1px #F0F6F8;}
    .seperate {
        width:1px;
        display:inline-block;
        background:#c0c5c6;
        height:12px;
        vertical-align:middle;
    }
    #cke_content_deal_comment{
        border: 1px solid #d8d8d8;
        width: 98%;
        background:transparent;
        padding: 0 0;
    }
    .cke_contents{
        background:transparent;
    }
    .toolbar_l  a em{
        font-size:16px;
    }
</style>


<div id="dealAreaThisRihgt" style="overflow:auto;" class="deal_area padding_b_10 clearfix form_area dealAreaThisRihgt">
    <div class="clearfix msg_title">
		<span>
			<strong>${permissionName}</strong>
		</span>
    </div>
    <div class="clearfix font_size12 margin_l_10 relative" style="margin-bottom: 5px;">
        <div id="toolb" class="left" style="min-height:37px;width: 240px; margin-top: 2px;"></div>
        <%--生成更多按钮--%>
        <c:if test="${(nodePerm_advanceActionList ne '[]') }">
				<span class="more_style more_style_position right margin_l_5" id="moreLabel" style="height:24px;line-height:24px;border-radius: 12px;">
					<a class="margin_l_5">${ctp:i18n('common.more.label')}</a>
					<span class="ico16 arrow_2_b"></span>
				</span>
        </c:if>
    </div>

    <input type="hidden" id="transferMemberId" />
    <!--处理意见区域-->
    <div class="opinions margin_l_15 margin_r_15">
        <!-- Dialog需要用到 -->
        <input type="hidden" id="nodeattitude" value="${nodeattitude}">
        <input type="hidden" id="permissionId" value="${permissionId}">
        <input type="hidden" id="superNodestatus" value="${superNodestatus}">
        <input type="hidden" id="hidAttitude" value="">
        <input type="hidden" id="hidAttitudeCode" value="">
        <c:if test="${nodeattitude != ''}">
            <div class="hr_heng">&nbsp;</div>
            <div class="common_radio_box padding_t_10 clearfix margin_b_10">
                <div class="left" id="attitudeInfo">
                    <c:set var="attitudeCount" value="0" />
                    <c:forEach items="${nodeattitudeList}" var="attitude">
                        <c:set var="attitudeCount" value="${attitudeCount+1 }" />
                        <label class="margin_r_10 hand" 
                        	<c:if test="${'disagree' eq attitude.code}"> for="notagree" </c:if>
                        	<c:if test="${'disagree' ne attitude.code}"> for="attitude_${attitudeCount }" </c:if>
                        	> <input
                        	<c:if test="${'disagree' eq attitude.code}"> id="notagree" </c:if>
                        	<c:if test="${'disagree' ne attitude.code}"> id="attitude_${attitudeCount }" </c:if>
                                 class="radio_com" name="attitude"
                                value="${attitude.value }" code="${attitude.code }" type="radio"
                                
                        <c:if test="${(commentDraft.extAtt1 eq null && defaultAttitude eq attitude.code) ||  ( commentDraft.extAtt4 ne null && commentDraft.extAtt4 eq attitude.code) }">
                                checked="checked"
                        </c:if>>
                            ${attitude.showValue}<!-- 已阅 -->
                        </label>
                    </c:forEach>
                </div>
            </div>
        </c:if>

        <c:if test="${ctp:containInCollection(basicActionList, 'Opinion')}">
            <script type="text/javascript">
                function attDivToggle(){
                    var elObj=arguments[1];
                    if(elObj!=null){
                        if($(elObj).find(".upload_files_msg").css("display")=="none"){
                            $(elObj).find(".upload_files_msg").show();
                        }else{
                            $(elObj).find(".upload_files_msg").hide();
                        }
                  }else{
                    if($(".upload_files_msg").css("display")=="none"){
                          $(".upload_files_msg").show();
                    }else{
                         $(".upload_files_msg").hide();
                    }
                }

                }

            </script>
            <div id="areaTopDiv" class="area_top" <c:if test='${nodeattitude != ""}'>style="margin-top:10px;"</c:if>>
                <c:set value="${ctp:containInCollection(basicActionList, 'UploadAttachment')}" var="__canUploadAttachment"/>
                <c:set value="${ctp:containInCollection(basicActionList, 'UploadRelDoc')}" var="__UploadRelDoc"/>
                <c:if test="${(__canUploadAttachment || __UploadRelDoc)}">
			<span class="area_top_icon relative" onmouseout="attDivToggle(null,this)" onmouseover="attDivToggle(null,this)">			<span class="ico24 attachment_24" id="files_upload_type" ></span>
				<ul class="absolute upload_files_msg">
					<c:if test="${__canUploadAttachment}">
                        <li id="uploadAttachmentID" style="float:left;"><span class="ico24 localhost_upload_24 margin_r_10 margin_l_5"></span>${ctp:i18n('permission.operation.UploadAttachment')}</li>
                    </c:if>
					<c:if test="${__UploadRelDoc}">
                        <li id="uploadRelDocID" style="float:left;"><span class="ico24 related_document_24 margin_r_10 margin_l_5"></span>${ctp:i18n('permission.operation.UploadRelDoc')}</li>
                    </c:if>
				</ul>
			</span>
                </c:if>
                <span class="line"></span>
                    <%-- @功能 --%>
                <span class="area_top_icon" onclick="showAtSelectWin()">
			<span class="ico24 at_24"></span>
		</span>
                <span class="line"></span>

                <span class="area_top_icon">

			<c:set var="praiseTip" value="${ctp:i18n('collaboration.summary.label.praise') }"/>
			<c:set var="praiseTipCancel" value="${ctp:i18n('collaboration.summary.label.praisecancel') }"/>

                    <!-- wxj 允许点赞 -->
            <c:if test="${summaryVO.canPraise}">
                <c:set var ="parseTitle" value="${commentDraft.praiseToSummary ? praiseTipCancel :praiseTip }"/>
                <span id="praiseToObj" title="${parseTitle}" class="ico16 ${commentDraft.praiseToSummary ? 'like_16' : 'no_like_16' }" style="width:16px;" onclick='praiseToSummary()'></span>
            </c:if>
		</span>
                <span class="line"></span>

                <span class="area_top_icon" onclick="initEditorAndShow('content_deal_comment')">
			<span class="ico24 editor_24"></span>
		</span>
                <c:if test="${ctp:containInCollection(basicActionList, 'CommonPhrase')}">
                    <div class="right margin_r_10"><a id="cphrase" curUser="${CurrentUser.id}" title="${ctp:i18n('collaboration.common.commonLanguage')}">
                        ${ctp:i18n('permission.operation.CommonPhrase')}<!-- 常用语 --></a>
                    </div>
                </c:if>
            </div>

            <textarea id="content_deal_comment" name="content_deal_comment"  onfocus="onFocusPlaceHolder('content_deal_comment')" onblur="onBlurPlaceHolder('content_deal_comment')"
                      comp="type:'editor',contentType:'html',height:'220px',defaultStyle:'*{font-size:14px}body.cke_editable{font-size:14px;}',toolbarSet:'VerySimple',autoResize:false,showToolbar:true"
                      class="compOptions" placeholder="${fn:escapeXml(nodeDesc)}" errorIcon="false" style="width: 95%; padding:0px 5px;height: 220px;font-size:14px;">${empty commentDraft.richContent ? commentDraft.content : ctp:toHTMLWithoutSpace(commentDraft.richContent)}</textarea>

            <div>
                <div id="attachmentTR${commentId}" style="display: none;"  class="attachment_files">
                    <div id="content_deal_attach" isGrid="true" class="comp"
                         comp="type:'fileupload',applicationCategory:'1',attachmentTrId:'${commentId}',canFavourite:false,canDeleteOriginalAtts:true"
                         attsdata='${handleAttachJSON }'></div>
                </div>
                <div id="attachment2TR${commentId}" style="display: none;border-top:1px solid #d7d7d7;margin-top:3px;" class="attachment_files">
                    <div id="content_deal_assdoc" isGrid="true" class="comp"
                         comp="type:'assdoc',applicationCategory:'1',attachmentTrId:'${commentId}',modids:'1,3',canFavourite:false,canDeleteOriginalAtts:true"
                         attsdata='${handleAttachJSON }'></div>
                </div>
            </div>
        </c:if>

        <div class="default_handle" style="display:${summaryVO.summary.templeteId ne null ?  'block':'none'}">
            <c:if test="${ctp:containInCollection(basicActionList, 'Opinion')}">
                <div class="clearfix margin_t_10">
                    <div class="common_checkbox_box clearfix left margin_t_5"><label
                            class="margin_r_10 hand" for="isHidden" id="isHiddenLable"> <input id="isHidden"
                                                                                               class="radio_com" name="isHidden" type="checkbox">${ctp:i18n('collaboration.common.default.commentHidden')}<!-- 意见隐藏 -->
                    </label></div>
                    <div id="showToIdSpan" class="common_txtbox common_txtbox_dis clearfix">
                        <label class="margin_r_10 left title">${ctp:i18n('collaboration.opinion.doNotInclude')}:</label><!-- 不包括 -->
                        <div class="common_txtbox_wrap"><input type="text"
                                                               id="showToIdInput" name="showToIdInput" class="comp"
                                                               comp='type:"selectPeople",showBtn:false,panels:"Department,Team,Post,Outworker,RelatePeople,JoinOrganization",minSize:0,selectType:"Member",showFlowTypeRadio: false'
                                                               value="${ctp:i18n('collaboration.common.default.clickOpenPeople')}"><!-- 点击选择公开人 -->
                        </div>
                    </div>
                </div>
            </c:if>
            <c:if test="${ctp:containInCollection(basicActionList, 'Track')}">
                <div id='trackDiv_detail'
                     class="common_radio_box common_checkbox_box clearfix margin_t_10">
                    <label class="margin_r_10 hand" for="isTrack" id="isTrackLable">
                        <input id="isTrack" class="radio_com" name="isTrack"  onclick="trackBoxFunc()" value="1" type="checkbox">${ctp:i18n('permission.operation.Track')}<!-- 跟踪 -->
                    </label>
                    <label class="margin_r_10 disabled_color hand" for="trackRange_all" id="label_all">
                        <input id="trackRange_all" class="radio_com" name="trackRange" onclick="trackAllFunc()" value="1" type="radio" disabled="disabled">${ctp:i18n('collaboration.listDone.all')}<!-- 全部 -->
                    </label>
                    <label class="margin_r_10 disabled_color hand"
                           for="trackRange_members" id="label_members"> <input onclick="trackPart()"
                                                                               id="trackRange_members" class="radio_com" name="trackRange" value="0"
                                                                               type="radio" disabled="disabled">${ctp:i18n('collaboration.listDone.designee')}<!-- 指定人 -->
                    </label> <input type="hidden" id="zdgzry" name="zdgzry" value="${trackOnlyIds}"></input><input id="trackRange_members_textbox" readonly onclick="javascript:toggleTrackRange_members()" type="text" class="hidden" value="${trackNames}" style="width:112px;"/>
                </div>
            </c:if> <%-- 归档--%> <c:if test="${canArchive}">
            <div class="clearfix margin_t_10 nodePerm" baseAction="Archive">
                <div class="common_checkbox_box clearfix"><label
                        class="margin_r_10 hand" for="pigeonhole" id="pigeonholeLable"> <input
                        id="pigeonhole" class="radio_com" name="pigeonhole" value="0"
                        type="checkbox">${ctp:i18n('permission.operation.Archive')}<!-- 处理后归档 -->
                    <input id="pigeonholeValue" name="pigeonholeValue" type="hidden">
                </label></div>
            </div>
        </c:if>
        </div>
        <div class="margin_t_10 font_size12 hand showHide" id="_showOrCloseBtn" onclick="showHideFunc()">
            <c:set value="${summaryVO.summary.templeteId ne null}" var="__isTemplate" />
            <span class="ico16 ${__isTemplate ?  'arrow_2_t' : 'arrow_2_b'} margin_b_5"></span>
            <c:set value="${ctp:i18n('collaboration.summary.label.open.js') }" var="openLabel" />
            <c:set value="${ctp:i18n('collaboration.summary.label.close.js') }" var="closeLabel" />
            <span class="color_blue">${__isTemplate ?  closeLabel : openLabel}</span>
        </div>

    </div>
    <!-- <div class="clearfix right" id="_dealDiv"> -->
    <c:if test="${!hasFormLock}">
        <div class="clearfix right padding_t_8" id="_dealDiv" style="box-sizing: border-box;width: 350px;padding-right: 15px;">
 
             <c:if test="${(ctp:containInCollection(basicActionList, 'Comment'))}">
                 <div class="right" style="margin-bottom:8px;">
                     
                     <input id="_dealSaveWait" style="width: auto; max-width: none; min-width: 63px;"
                            onclick="dealDoZcdbFunc()" value="${ctp:i18n('permission.operation.Comment') }" type="button"
                            class="common_button common_button_seeyon margin_r_5 hand" />
                 </div>
                 <!-- 暂存待办 -->
             </c:if>



             <c:if test="${(isAudit ne 'true' and isVouch ne 'true' and ctp:containInCollection(basicActionList, 'Opinion') and ctp:containInCollection(basicActionList, 'Comment'))}">
                <div class="right" style="margin-bottom:8px;">
                    <input id="_dealSaveDraft" style="width: auto; max-width: none; min-width: 63px;"
                           onclick="dealDoSaveDraft()" value="${ctp:i18n('collaboration.newcoll.saveDraft')}"
                           type="button" class="common_button common_button_seeyon margin_r_5 hand" />
                </div>
            </c:if>


             <c:if test="${ (isIssus eq 'true')}">
                  <div class="right" style="margin-bottom:8px;">

                    <input id="_dealNotPass" style="width: auto; max-width: none; min-width: 63px;"
	                  onclick="stepStopFunc()" value="${ctp:i18n('collaboration.common.default.notPass')}"
	                  type="button" class="common_button common_button_seeyon margin_r_5 hand" />
                  <!-- 不通过 -->
                  </div>
                 
                 <div class="right" style="margin-bottom:8px;">
                     <input id="_dealPass1" style="width: auto; max-width: none; min-width: 63px;"
                            onclick="dealPass1Func()"
                            value="${ctp:i18n('collaboration.common.default.adoptedAndPublished')}" type="button"
                            class="common_button common_button_emphasize margin_r_5 hand" style="width:70px;" />
                     <!-- 通过并发布 -->
               </div>

             </c:if>

             <c:if test="${ (isVouch eq 'true')}">
                <div class="right" style="margin-bottom:8px;">
                    <input id="_vouchPass" style="width: auto; max-width: none; min-width: 63px;"
                           onclick="dealDoVochPass()" value="${ctp:i18n('collaboration.common.default.approvedBy')}"
                           type="button" class="common_button common_button_emphasize margin_r_5 hand" />
                    <!-- 核定通过 -->
                    <input id="_vouchNotPass" style="width: auto; max-width: none; min-width: 63px;"
                           onclick="dealDoVochNotPass()"
                           value="${ctp:i18n('collaboration.common.default.approvedNotBy')}" type="button"
                           class="common_button common_button_seeyon margin_r_5 hand" style="width:70px;" />
                    <!-- 核定不通过 -->
                </div>
            </c:if>

 
             <c:if test="${(isAudit eq 'true')}">
                <div class="right" style="margin-bottom:8px;">
                    <input id="_auditPass" style="width: auto; max-width: none; min-width: 63px;"
                           onclick="dealDoAuditPass()" value="${ctp:i18n('collaboration.common.default.auditBy')}"
                           type="button" class="common_button common_button_emphasize margin_r_5 hand" />
                    <!-- 审核通过 -->
                     <input id="_auditNotPass" style="width: auto; max-width: none; min-width: 63px;"
                            onclick="dealDoAuditNotPass()"
                            value="${ctp:i18n('collaboration.common.default.anAuditNotPassed')}" type="button"
                            class="common_button common_button_seeyon margin_r_5 hand" style="width:70px;" />
                     <!-- 审核不通过 -->
                </div>
            </c:if>
            
  			<!-- shkk 添加意见区预览按钮 start -->
            <%-- window.parent.parent.previewKK() 在 /common/cap4/template/display/pc/form/dist/index.html 意见区预览 --%>
			<div class="right" style="margin-bottom:8px;">
				<input id="_dealSubmit" onclick="window.parent.parent.previewKK()" type="button"
					class="common_button common_button_seeyon margin_r_5 hand"
					value="意见预览" />
			</div>
			<!-- shkk 添加意见区预览按钮 end -->

             <%--提交--%>
             <c:if test="${(isIssus ne 'true' and isAudit ne 'true' and isVouch ne 'true') && commitType}">
                 <div class="right" style="margin-bottom:8px;">
                     <input id="_dealSubmit" onclick="submitClickFunc()" type="button"
                            class="common_button common_button_emphasize margin_r_5 hand"
                            value="${ctp:i18n('permission.operation.ContinueSubmit')}" />
                 </div>
             </c:if>
        </div>
    </c:if>
    <div id="customerToolBar" class="left" style="width: 320px; margin-top: -10px;padding-left:9px;"></div>
</div>
<div id="comment_deal" class="display_none">
    <input type="hidden" id="id" value="${commentDraft.id}">
    <input type="hidden" id="draftCommentId" value="${commentDraft.id}">
    <input type="hidden" id="pid" value="0">
    <input type="hidden" id="clevel" value="1">
    <input type="hidden" id="path" value="pc">
    <input type="hidden" id="moduleType" value="1">
    <input type="hidden" id="moduleId" value="${summaryVO.summary.id}">
    <input type="hidden" id="extAtt1">
    <input type="hidden" id="extAtt4">
    <input type="hidden" id="ctype" value="0">
    <input type="hidden" id="content">
    <input type="hidden" id="hidden">
    <input type="hidden" id="showToId">
    <input type="hidden" id="affairId" value="${summaryVO.affairId}">
    <input type="hidden" id="relateInfo">
    <%-- 这里写死为true，表示发送消息 --%>
    <input type="hidden" id="pushMessage" value="true"/>
    <%-- 6.0@功能改造， 不使用消息推送了，后面不改就删了吧 add by xuqw
    <input type="hidden" id="pushMessage" value="false">
     --%>
    <input type="hidden" id="pushMessageToMembers">
    <%-- @all的时候保存at人员的信息 --%>
    <input type="hidden" id="atAllMembers" name="atAllMembers"/>
    <input type="hidden" id="praiseInput" value="0"></input>
    <input type="hidden" id="richContent" value="">
</div>

<script type="text/javascript">
    var nodePerm_baseActionList = <c:out value="${nodePerm_baseActionList}" default="null" escapeXml="false"/>;
    var nodePerm_commonActionList = <c:out value="${nodePerm_commonActionList}" default="null" escapeXml="false"/>;
    var nodePerm_advanceActionList = <c:out value="${nodePerm_advanceActionList}" default="null" escapeXml="false"/>;
    var subState = "${summaryVO.affair.subState}";
    var state = '${summaryVO.affair.state}';
    var inInSpecialSB = '${inInSpecialSB}';
    var affairId = "${summaryVO.affairId}";
    var templeteId = "${summaryVO.summary.templeteId}";
    var processId = "${summaryVO.summary.processId}";
    var summaryId= '${summaryVO.summary.id}';
    var bodyType = '${summaryVO.summary.bodyType}';

    var wfItemId = '${contentContext.wfItemId}';
    var wfProcessId = '${contentContext.wfProcessId}';
    var wfActivityId = '${contentContext.wfActivityId}';
    var currUserId = '${CurrentUser.id}';
    var wfCaseId = '${contentContext.wfCaseId}';
    var moduleTypeName = '${contentContext.moduleTypeName}';
    var flowPermAccountId = '${summaryVO.flowPermAccountId}';
    //var affairId = '${summaryVO.affairId}';
    var nodePolicy = '${ctp:escapeJavascript(nodePolicy)}';
    var currLoginAccount= '${CurrentUser.loginAccount}';
    //var processId = '${summaryVO.summary.processId}';
    var collEnumKey = "${collEnumKey}";
    var forwardEventSubject = "${ctp:escapeJavascript(forwardEventSubject)}";
    var commonActionNodeCount = '${commonActionNodeCount}';
    var startCfg = "${contentCfg.useWorkflow and  nodePerm_advanceActionList ne '[]'}";
    var canModifyWorkFlow = '${canModifyWorkFlow }';
    var startMemberId = '${summaryVO.summary.startMemberId}';
    var stateMemberName = '${ctp:escapeJavascript(summaryVO.startMemberName)}';
    var affairMemberId = '${summaryVO.affair.memberId}';
    var isNewfolw = '${summaryVO.isNewflow}';
    var workItemId = '${summaryVO.workitemId}';
    var trackMember="${trackIds}";
    var commentId = '${commentId }';
    var isTemplete = '${isTemplete}'=='true'? true : false;
    var displayIds = '${displayIds }';
    var displayNames = '${displayNames }';
    var nodeDesc = '${ctp:escapeJavascript(nodeDesc)}';
    var drafContent = '${ctp:escapeJavascript(commentDraft.content)}';
    var richContent = '${ctp:escapeJavascript(commentDraft.richContent)}';


    //是否已经存在回复信息，用于控制at人员匹配规则
    var hasContent = false;
    function initHasContent() {
        if (drafContent || richContent) {
            hasContent = true;
        }
    }
    initHasContent();

    $.content.getContentDealDomains = function(domains) {
        if (!domains) {
            domains = [];
        }

        //修改a标签的target属性
        var contentCkeditor;
        if(typeof(CKEDITOR) === "undefined"){//无CKEDITOR对象，一般原因是未加载CKEDITOR相关的JS
            contentCkeditor = false;
        }else{
            contentCkeditor = CKEDITOR.instances['content_deal_comment'];
        }

        if (contentCkeditor) {
            var levels = [ "document", "$" ], index = 0, tempObj = contentCkeditor, contentDoc;
            while (tempObj = tempObj[levels[index]]) {
                index++;
                if (index == levels.length) {
                    contentDoc = tempObj;
                    break;
                }
            }
            if (contentDoc) {
                var aTags = contentDoc.getElementsByTagName("a");
                if (aTags) {
                    for (var i = 0; i < aTags.length; i++) {
                        aTags[i].setAttribute("target", "_blank");
                    }
                }
            }
        }

        var commentContent = getContentDealComment();
        var commentText = getTextDealComment();
        if ($.trim(commentText) != "" && commentText.length > 2000) {
            $.alert("${ctp:i18n('collaboration.common.deafult.dealCommentMaxSize')}");
            mainbody_callBack_failed();
            return false;
        }
        $("#comment_deal #content").val(commentText);
        $("#comment_deal #richContent").val(commentContent);
        <c:if test="${contentCfg.useWorkflow}">
        var attitudeDom = $("input[name='attitude']:checked");
        var extAtt1 = attitudeDom.val();
        var extAtt4 = attitudeDom.attr("code");
        //优先使用封装的态度
        if(typeof(PermissionDataHandler)!="undefined") {
        	if (PermissionDataHandler.hasAttitudeDialog()) {
        		extAtt1 = $("#hidAttitude").val();
                extAtt4 = $("#hidAttitudeCode").val();
	  		}
	    }
        $("#comment_deal #extAtt1").val(extAtt1);
        $("#comment_deal #extAtt4").val(extAtt4);
        </c:if>
        $("#comment_deal #hidden").val($("#isHidden").attr('checked') == "checked");
        $("#comment_deal #showToId").val($("#showToIdInput").val());
        if ($("#content_deal_comment").length > 0) {
            $("#content_deal_attach").html("");
            saveAttachmentPart("content_deal_attach");
            $("#comment_deal #relateInfo").val($.toJSON($("#content_deal_attach").formobj()));
        }

        var tempAtUserData = [];
        if (hasContent) {
            tempAtUserData = getAllAtUserData();
        } else {
            tempAtUserData = atUserData;
        }

        var memberIds = [];
        for (var i = 0; i < tempAtUserData.length; i++) {
            var obj = tempAtUserData[i];
            if (commentText.indexOf(obj.content) > -1) {
                if("@All" == obj.content){
                    var allUserData = getAllAtUserData();
                    for(var j = 0; j < allUserData.length; j++){
                        var allObj = allUserData[j];
                        var temp = {
                            affairId : allObj.affairId,
                            memberId : allObj.memberId
                        };
                        memberIds.push(temp);
                    }
                }else{
                    var temp = {
                        affairId : obj.affairId,
                        memberId : obj.memberId
                    };
                    memberIds.push(temp);
                }
            }
        }
        $("#pushMessageToMembers").val($.toJSON(memberIds));
        domains.push("comment_deal");
        return domains;
    };
    if (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1
        && navigator.userAgent.toLowerCase().indexOf("safari") != -1) {
        $(".radio_com").css("margin-top", 0);
    }
    //常用语国际化太长，按产品经理要求截取
    var _phrase = $("#cphrase").attr("title");
    if (_phrase && _phrase.length > 3) {
        $("#cphrase").html(_phrase.substring(0, 7) + "...");
    }
</script>





